<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/aftersaleinfo/serve_contract/q_serve_contract.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/aftersaleinfo/serve_contract/q_serve_contract.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Serve_contract',
                footer: "Foots",
                cnName: '售后服务合同',
                name: 'serve_contract/q_serve_contract',
                url: "/q_serve_contract/",
                sortName: "Voucher_sub"
            });
            const editFormFields = ref({"Voucher_sub":"","Voucher_sub_aftersale":"","Client":"","Signed_date":"","Service_charge":"","Tax_rate":"","Maintain_date":"","Check_out_flag":"","WHSE_no":"","Attachment":"","Image":"","Remark":"","Contract_total_prices":"","Tax_exclusive_contract_total_prices":"","Goods_num":"","Aftersale_ID":""});
            const editFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub","type":"text"},
                               {"dataKey":"无条件客户","data":[],"title":"客户","required":true,"field":"Client","type":"select"},
                               {"title":"售后服务单","required":true,"field":"Voucher_sub_aftersale","type":"text"},
                               {"title":"签订时间","required":true,"field":"Signed_date","type":"datetime"}],
                              [{"dataKey":"结账类型","data":[],"title":"付款方式","required":true,"field":"Check_out_flag","type":"select"},
                               {"dataKey":"税率","data":[],"title":"税率","required":true,"field":"Tax_rate","type":"select"},
                               {"title":"技术服务费","required":true,"field":"Service_charge","type":"number"},
                               {"title":"维修时长","required":true,"field":"Maintain_date","type":"text"}],
                              [{"dataKey":"一级仓库","data":[],"title":"机构","field":"WHSE_no","type":"select"},
                               {"title":"备注","field":"Remark","type":"textarea"},
                               {"title":"附件","field":"Attachment","type":"file"},
                               {"title":"图片","field":"Image","type":"img"}],
                              [{"title":"配件数量","required":true,"field":"Goods_num","type":"text"},
                               {"title":"合同金额","required":true,"field":"Contract_total_prices","type":"text"},
                               {"title":"无税合同金额","required":true,"field":"Tax_exclusive_contract_total_prices","type":"text"}],
                              [{"title":"售后服务单ID","field":"Aftersale_ID","type":"text"}]]);
            const searchFormFields = ref({"Voucher_sub":"","Voucher_sub_aftersale":"","Client":"","Signed_date":"","WHSE_no":"","AuditStatus":"","AuditDate":"","CreateDate":""});
            const searchFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub","type":"like"},{"title":"售后服务单","field":"Voucher_sub_aftersale","type":"like"},{"dataKey":"无条件客户","data":[],"title":"客户","field":"Client","type":"select"},{"dataKey":"一级仓库","data":[],"title":"机构","field":"WHSE_no","type":"select"}],[{"title":"签订时间","field":"Signed_date","type":"datetime"},{"dataKey":"audit","data":[],"title":"审核状态","field":"AuditStatus","type":"select"},{"title":"审核时间","field":"AuditDate","type":"datetime"},{"title":"创建时间","field":"CreateDate","type":"datetime"}]]);
            const columns = ref([{field:'Voucher_sub',title:'单据编码',type:'string',link:true,width:180,align:'left',sort:true},
                       {field:'Voucher_sub_aftersale',title:'售后服务单',type:'string',width:180,require:true,align:'left'},
                       {field:'Client',title:'客户',type:'int',bind:{ key:'无条件客户',data:[]},width:110,require:true,align:'left'},
                       {field:'Contract_total_prices',title:'合同金额',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Tax_exclusive_contract_total_prices',title:'无税合同金额',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Goods_num',title:'配件数量',type:'float',width:110,require:true,align:'left'},
                       {field:'Service_charge',title:'技术服务费',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Tax_rate',title:'税率',type:'decimal',bind:{ key:'税率',data:[]},width:110,require:true,align:'left'},
                       {field:'Signed_date',title:'签订时间',type:'datetime',width:155,require:true,align:'left',sort:true},
                       {field:'Maintain_date',title:'维修时长',type:'string',width:120,require:true,align:'left'},
                       {field:'Check_out_flag',title:'付款方式',type:'int',bind:{ key:'结账类型',data:[]},width:110,require:true,align:'left'},
                       {field:'WHSE_no',title:'机构',type:'string',bind:{ key:'一级仓库',data:[]},width:110,align:'left'},
                       {field:'Attachment',title:'附件',type:'file',width:110,align:'left'},
                       {field:'Image',title:'图片',type:'img',width:110,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Serve_contract',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'Aftersale_ID',title:'售后服务单ID',type:'guid',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "服务合同明细",
                table: "q_serve_contractList",
                columns: [{field:'Serve_contractList',title:'ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Serve_contract',title:'父级ID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'Goods_sub',title:'商品编码',type:'string',width:110,align:'left',sort:true},
                       {field:'Goods_name',title:'商品名称',type:'string',width:220,align:'left'},
                       {field:'Goods_size',title:'规格型号',type:'string',width:110,align:'left'},
                       {field:'Cost_price',title:'成本价',type:'decimal',width:110,hidden:true,require:true,align:'left'},
                       {field:'Goods_num',title:'数量',type:'float',width:110,edit:{type:'number'},require:true,align:'left'},
                       {field:'Goods_price',title:'单价',type:'decimal',width:110,edit:{type:'number'},require:true,align:'left'},
                       {field:'Tax_exclusive_goods_price',title:'无税单价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Total_price',title:'总价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Tax_exclusive_total_price',title:'无税总价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'WHSE_name',title:'库位名称',type:'string',bind:{ key:'库位编码',data:[]},width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,edit:{type:''},align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'AuditStatus',title:'审核状态',type:'int',width:110,hidden:true,align:'left'},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Tax_exclusive',title:'无税成本',type:'decimal',width:110,hidden:true,require:true,align:'left'},
                       {field:'Tax_exclusive_cost_total_price',title:'无税成本总价',type:'decimal',width:110,hidden:true,require:true,align:'left'},
                       {field:'Cost_total_price',title:'成本总价',type:'decimal',width:110,hidden:true,require:true,align:'left'},
                       {field:'goodsInventoryWarehouseXm',title:'库存表ID',type:'guid',width:110,hidden:true,align:'left'}],
                sortName: "Goods_sub",
                key: "Serve_contractList"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
